package com.atguigu.gmall.product.controller;

import com.atguigu.gmall.common.result.Result;
import com.atguigu.gmall.product.service.TestService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 测试锁
 */
@RestController
@RequestMapping("/admin/product/test")
public class TestLockController {


    @Autowired
    private TestService testService;

    @GetMapping("lock")
    public Result testLockMethod(){

        testService.testLockMethod();
        return Result.ok();
    }
    @GetMapping("read")
    public Result testReadMethod(){

        return Result.ok(testService.testReadMethod());
    }
    @GetMapping("write")
    public Result testwriteMethod(){

        return Result.ok(testService.testWriteMethod());
    }
}
